package com.wu.springboot_study.controller;

import com.wu.springboot_study.annotion.OnlyCallOnce;
import com.wu.springboot_study.config.UserConfig;
import com.wu.springboot_study.entity.User;
import com.wu.springboot_study.service.IUserService;
import com.wu.springboot_study.service.impl.UserServiceImpl;
import com.wu.springboot_study.util.JedisUtil;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

/**
 * @author benjamin_5
 * @Description
 * @date 2022/12/1
 */
@Controller
@RequestMapping("user2")
@AllArgsConstructor
public class UserController {

    private final IUserService userService;

    @GetMapping("list")
    @OnlyCallOnce
    public String list(String name, Integer age, Model model){
        model.addAttribute("list2",this.userService.list(name, age));
        return "html/thymelead-list";
    }




}
